package org.ponly.cta4j.drawing.text.glyphsvisitor;

import org.ponly.cta4j.drawing.text.Glyphs;

import java.awt.geom.Rectangle2D;

/**
 * 还原移动
 *
 * @author mag
 * @Date 6 mars 2008
 */
public class MoveAllGlyphsToOriginVisitor implements GlyphsVisitor {


    public void visit(Glyphs glyphs, Rectangle2D backgroundBounds) {
        for (int i = 0; i < glyphs.size(); i++) {

            double tx = -glyphs.getX(i);
            double ty = -glyphs.getY(i);
            glyphs.translate(i, tx, ty);
        }
    }
}